--create table nhanvien
if exists (select * from dbo.sysobjects where name ='NHANVIEN')
begin
	drop table NHANVIEN
end
Go
create table NHANVIEN
(
	MANV	varchar(10),
	TEN		nvarchar(20),
	DCHI	nvarchar(50),
	DTHOAI	varchar(15),
	LUONG	float,
	LOAINV	int
	primary key (MANV)
)
select * from NHANVIEN

--create table khachhang
if exists (select * from dbo.sysObjects where name ='KHACHHANG')
begin
	drop table KHACHHANG
end
Go
create table KHACHHANG
(
	MAKH	varchar(10),
	TEN		nvarchar(10),
	DCHI	varchar(30),
	DTHOAI	varchar(40)
	primary key (MAKH)
)
select * from KHACHHANG

--create table khanang
if exists (select * from dbo.sysObjects where name ='KHANANG')
begin
	drop table KHANANG
end
Go
create table KHANANG
(
	MANV	varchar(10),
	MALOAI	varchar(10)
	primary key(MANV,MALOAI)
)
select * from KHANANG

--create table loai may bay
if exists (select * from dbo.sysObjects where name ='LOAIMB')
begin
	drop table LOAIMB
end
Go
create table LOAIMB
(
	HANGSX	varchar(10),
	MALOAI	varchar(10)
primary key (MALOAI)
)
select * from LOAIMB

--create table dat cho
if exists (select * from dbo.sysObjects where name ='DATCHO')
begin
	drop table DATCHO
end
Go
create table DATCHO
(
	MAKH	varchar(10),
	NGAYDI	datetime,
	MACB	varchar(10)
primary key(MAKH,NGAYDI,MACB)
)
select * from DATCHO

--create table phan cong
if exists (select * from dbo.sysObjects where name ='PHANCONG')
begin
	drop table PHANCONG
end
Go
create table PHANCONG
(
	MANV	varchar(10),
	NGAYDI	datetime,
	MACB	varchar(10)
primary key(MANV,NGAYDI,MACB)
)
select * from PHANCONG

--create table LICH BAY
if exists (select * from dbo.sysObjects where name ='LICHBAY')
begin
	drop table LICHBAY
end
Go
create table LICHBAY
(
	NGAYDI	datetime,
	MACB	varchar(10),
	SOHIEU	int not null,
	MALOAI	varchar(10)
primary key(NGAYDI,MACB)
)
select * from LICHBAY

--create table chuyen bay
if exists (select * from dbo.sysObjects where name ='CHUYENBAY')
begin
	drop table CHUYENBAY
end
Go
create table CHUYENBAY
(
	MACB	varchar(10),
	SBDI	varchar(10),
	SBDEN	varchar(10),
	GIODI	datetime,
	GIODEN	datetime
primary key (MACB)
)
select * from CHUYENBAY

--create tabel MAYBAY
if exists (select * from dbo.sysObjects where name ='MAYBAY')
begin
	drop table MAYBAY
end
Go
create table MAYBAY
(
	SOHIEU	int,
	MALOAI	varchar(10)
primary key(SOHIEU,MALOAI)
)
select * from MAYBAY
